<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
    <meta name="apple-touch-fullscreen" content="yes">
    <meta name="apple-mobile-web-app-capable" content="yes"/>
    <meta name="apple-mobile-web-app-status-bar-style" content="black"/>
    <!-- <link rel="apple-touch-icon" href="http://img.nala.com.cn/images/touch-logo.png"> -->
    <meta name="format-detection" content="telephone=no"/>

    <meta name="screen-orientation" content="portrait"><!-- uc强制竖屏 -->
    <meta name="x5-orientation" content="portrait"><!-- QQ强制竖屏 -->

    <meta name="application-name" content="快来喊小伙伴一起来浇水吧！"/>
    <meta name="author" content="m.amao.com"/>
    <title>开来领取爱心树吧!</title>

    <link rel="stylesheet" href="css/global.css">
    <script src="js/zepto.js"></script>
    <script src="js/zeptofix.js"></script>
    <script src="js/global.js"></script>

    <style type="text/css">

#header{height:44px;-webkit-tap-highlight-color:rgba(0,0,0,0)}
#header
.bd{background-color:#f70;height:40px;padding:2px
0;line-height:40px;text-align:center;color:#fff;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}
#header .bd
a{display:block;width:40px;height:40px;text-align:center;font-size:16px;color:#fff}
#header .bd a:visited{color:#fff}
#header .bd a:active{background-color:#f50}
#header .bd a img{vertical-align:middle}
#header .bd
h2{font-size:18px;-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1}
#header .bd .right
i{font-size:18px}
.header_more_active{background-color:#f50}
.regform{margin-top:30px;padding:0 20px}
.form{ margin-bottom: 20px; border:1px solid #ccc;background-color:#fff;border-radius:4px}
.form dl{border-bottom:1px solid #ddd;display:-webkit-box}
.form dl:last-child{border-bottom:none}
.form
dt{width:84px;padding:14px
0 12px 10px;text-align:right;font-size:16px}
.form
dd{-webkit-box-flex:1;padding:14px
5px 12px}
.form dd
input.txt{border:none;width:100%;font-size:16px;-webkit-tap-highlight-color:rgba(0,0,0,0)}
.submit{padding-top:30px}
.submit
.btn{padding:15px
0;display:block;text-align:center;font-size:20px}
.submit
input.btn{height:48px;width:100%;cursor:pointer;border:none}
.submit
input.disabled{background:#ddd;box-shadow:none;text-shadow:none;border-color:#ccc;cursor:default;color:#999}

    </style>
</head>
<body>
    <header id="header">
        <div class="bd">
            <a href="javascript:history.go(-1);" class="back"><img src="images/register.png"></a>
            <h2>领取爱心树</h2>
            <a href="javascript:;" class="right"></a>
        </div>
    </header>
    <div class="ctmain">
        <div class="regform">
            <form action="/newStudent" method="post" id="register">
                <input type="hidden" name="studentid" value="" />
                <div class="form">
                    <dl>
                        <dt>学校：</dt>
                        <dd>
                            <input type="text" class="txt" name="school" placeholder="请输入您所在的学校" />
                        </dd>
                    </dl>
                </div>
                <div class="form">
                    <dl>
                        <dt>班级：</dt>
                        <dd>
                            <input type="text" class="txt" name="class" placeholder="请输入您所在的班级" />
                        </dd>
                    </dl>
                </div>
            </form>
            <section class="submit">
                <a href="javascript:;" id="reg_submit" class="btn">立即领取</a>
            </section>
        </div>
    </div>
<script type="text/javascript">
    var user = {
            studenid: {}
        };
    $(function(){
        var $btn = $("#reg_submit") ,
            $form = $("#register") ,
            $input = $("input") ,
            $school = $input.filter("[name='school']") ,
            $classes = $input.filter("[name='class']") ,
            $studentid = $input.filter("[name='studentid']") ;
        $studentid.val( user.studenid );
        $btn.on("click",function(){
            var school = $.trim( $school.val() ) ,
                classes = $.trim( $classes.val() ) ;
            if( school == "" ){
                TBS.dialog.tip("请输入您所在的学校");
                return false;
            };
            if( classes == "" ){
                TBS.dialog.tip("请输入您所在的班级");
                return false;
            };
            $form.submit();
        });
    });
</script>
</body>
</html>